home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-09-27 | 4.4 KB | 165 lines | [TEXT/nX^n] |
- --------------------------------------------------------------------
- --
- -- STARTUPSESSION function
- -- Startup the session by an INIT, OPEN, and CONNECT.
- -- Return true if startup was done without error.
- -- If any error occurs, terminate and return false.
- --
- -- Script by John R. Powers, III
- -- Easy Street Software
- --
- -- XFCNs used: TriData3270
- -- XCMDs used: none
- -- HANDLERS used: setupGlobals, showResult, updateDebug
- -- FUNCTIONS used: none
- --
- function startupSession
- setupGlobals
- get TriData3270("INIT_3270_API", "myMethod")
- showResult(it)
- if item 1 of it ≠ 0 then return false
- get TriData3270("OPEN_HOST_CONNECTION", "myMethod")
- showResult(it)
- if item 1 of it ≠ 0 then
- get TriData3270("TERM_3270_API")
- return false
- end if
- get TriData3270("CONNECT_TO_PS", "mySession", "sync", "")
- showResult(it)
- if item 1 of it ≠ 0 then
- get TriData3270("TERM_3270_API")
- return false
- end if
- updateDebug
- return true
- end startupSession
-
- --------------------------------------------------------------------
- --
- -- GET_UPDATE button
- -- Initiate an async Get_Update for PS and OIA.
- -- Handlers are in the background script.
- --
- -- Script by John R. Powers, III
- -- Easy Street Software
- --
- -- XFCNs used: TriData3270
- -- XCMDs used: none
- -- HANDLERS used: showResult, updateStatus
- -- FUNCTIONS used: none
- --
- on mouseUp
- global TD3270temp
- showResult(tridata3270("GET_UPDATE",¬
- "mySession","async","50","cd fld PS","","","","cd fld OIA"))
- updateStatus
- end mouseUp
-
- --------------------------------------------------------------------
- --
- -- CHKUPD button
- -- Check the state of Get_Update.
- -- This forces an update of the fields passed
- -- in the Get_Update command.
- -- Handlers are in the background script.
- --
- -- Script by John R. Powers, III
- -- Easy Street Software
- --
- -- XFCNs used: TriData3270
- -- XCMDs used: none
- -- HANDLERS used: showResult, updateStatus
- -- FUNCTIONS used: none
- --
- on mouseUp
- global TD3270temp
- showResult(TriData3270State("GET_UPDATE", "mySession"))
- updateStatus
- end mouseUp
-
- --------------------------------------------------------------------
- --
- -- SHOWRESULT function
- -- Posts the return from the TriData3270 function.
- -- Separates the result code (always item #1).
- -- Gets the result message from the result code
- -- and posts both to the display.
- -- Also displays the mySession global since
- -- TriData3270 may have updated it.
- --
- -- Script by John R. Powers, III
- -- Easy Street Software
- --
- -- XFCNs used: TriData3270Result
- -- XCMDs used: none
- -- HANDLERS used: showResult
- -- FUNCTIONS used: none
- --
- on showResult resultInfo
- global mySession
- put empty into cd fld resultCode -- flash to show update
- put empty into cd fld resultMessage -- flash to show update
- put resultInfo into cd fld resultCode
- put TriData3270Result(item 1 of resultInfo) into cd fld resultMessage
- put mySession into cd fld Session
- end showResult
-
- --------------------------------------------------------------------
- --
- -- background field MEMORY HANDLE
- --
- -- Call the Debuger with the memory handle.
- -- Intended for use with MacsBug. The label
- -- "masHan" below refers to one of many MacsBug
- -- templates that were designed for TriData3270.
- -- It won't do you any good unless you have
- -- installed the TriData3270 templates in your MacsBug.
- -- MacsBug 6.0 or better is required for this feature.
- --
- -- Script by John R. Powers, III
- -- Easy Street Software
- --
- -- XFCNs used: none
- -- XCMDs used: DebugStr
- -- HANDLERS used: none
- -- FUNCTIONS used: none
- --
- on mouseUp
- global TD3270memory
- if TD3270memory is not empty then
- put ";dm" && TD3270memory && "masHan" into MacsBugStr
- DebugStr(MacsBugStr)
- else
- answer "Do INIT_3270_API to get memory handle."
- end if
- end mouseUp
-
- --------------------------------------------------------------------
- --
- -- background button DEBUG
- --
- -- Set the flag for XFCN internal use of DebugStr.
- --
- -- Script by John R. Powers, III
- -- Easy Street Software
- --
- -- XFCNs used: none
- -- XCMDs used: none
- -- HANDLERS used: none
- -- FUNCTIONS used: none
- --
- on mouseUp
- global TD3270debug
- answer "Set debug flag." with "On" or "Off"
- if it is "On" then
- answer "Debug when?" with "Before" or "After" or "Both"
- if it is "Before" then put 1 into TD3270debug
- else if it is "After" then put 2 into TD3270debug
- else if it is "Both" then put 3 into TD3270debug
- set the hilite of target to true
- else
- put 0 into TD3270debug
- set the hilite of target to false
- end if
- end mouseUp
-